const app = getApp()
Component({
  properties: {
    musicList: {
      type: Array
    }
  },
  data: {
    playingId: null,
  },
  pageLifetimes: {
    show() {
      this.setData({
        playingId: parseInt(app.getPlayMusicId())
      })
    }
  },
  methods: {
    onMusic(e) {
      const data = e.currentTarget.dataset
      this.setData({
        playingId: data.playingId
      })
      wx.navigateTo({
        url: `../../pages/player/player?musiclistId=${this.data.playingId}&index=${data.index}`,
      })
    }
  }
})
